from tkinter import *

print("Введите коэфициент X:")
X = int(input(""))
print("Введите коэфициент Y:")
Y = int(input(""))
print("Введите коэфициент N:")
N  = int(input(""))

cords = [0,0, 0,20 , 30,20, 30,0, 20,0, 20,10, 10,10, 10,0, 0,0]

if N == 0 and X>=0 and X<=500 and Y>0 and Y<=500:
         pass
else:
    if N >0 and 0*N+X>=0 and 0*N+Y>=0 and 20*N+X<=500 and 20*N+Y<=500:
        pass
    else:
        if N < 0 and 20*N+X>=0 and 20*N+Y>=0 and 0*N+X<=500 and 0*N+Y<=500:
            pass
        else:
            print("Размеры выходят за границу")
            exit()

root = Tk()
root.title("IT марафон")
root.geometry("500x500")
canvas = Canvas(bg="white", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)

canvas.create_polygon(cords[0] *N+X, cords[1]*N+Y,
                      cords[2] *N+X, cords[3]*N+Y,
                      cords[4] *N+X, cords[5]*N+Y,
                      cords[6] *N+X, cords[7]*N+Y,
                      cords[8] *N+X, cords[9]*N+Y,
                      cords[10] *N+X, cords[11]*N+Y,
                      cords[12] *N+X, cords[13]*N+Y,
                      cords[14] *N+X, cords[15]*N+Y)
root.mainloop()
